NOTICE REGARDING COPYRIGHT RIGHTS
A portion of the disclosure of this patent document contains material that is subject to copyright protection. The copyright owner has no objection to the facsimile reproduction by anyone of the patent document or the patent disclosure, as it appears in the Patent and Trademark Office file or records, but otherwise reserves all copyright rights whatsoever.
The present invention relates to database storage mechanisms for use by a data processing system, and in particular to a database system capable of storing a variety of pieces of information without regard to the specific structure of the information or how it is stored.
Database management systems are often rigidly structured to accept and store pieces of related information in a predefined format. The format, often referred to as the system""s schema, is designed to accept the information only in a particular form. If the form of that information changes, the schema must be changed to accommodate the new form; and the prior stored information may also need to be modified to fit the new schema. Neither task is insubstantial.
Also, it is sometimes desirable to associate auxiliary behavior or action to the specific operations of the management mechanism of the database system. For example, suppose the available functions of the management mechanism included xe2x80x9cget,xe2x80x9d xe2x80x9cput,xe2x80x9d and xe2x80x9cremovexe2x80x9d operations to respectively retrieve (get) specific information, store (put) a piece of information in, or to delete (remove) information from the database system. Also, it may be desirable to associate with a request for a get operation such auxiliary behavior as verifying the authority of the requester, or performing a translation of the information before providing it to the requester. However, should additional behavior or action be needed, beyond that already associated with the system operations, the schema of the database system must be modified to incorporate the new behavior or action, again a task of no small proportion.
Accordingly, it can be seen that a schemeless database system can provide a variety of advantages.
The present invention provides a simple technique for storing data items of varying forms and structures without requiring adherence to any specific schema. The invention accomplishes this technique by employing an object oriented program to create and store object instances of class types pertaining to the particular data item.
The invention utilizes a capability offered by the object oriented programming environment: using instance objects of pre-specified classes to represent variables of a user-defined data type. Broadly, the invention is an information storage system that includes a storage manager, a persistent store (e.g., disk storage or other permanent storage) that is administered by the storage manager, and an object catalog that contains the definitions of what the persistent store can contain in terms of object-oriented class specifications. Data items are kept in the persistent store as object instances of a type specified by information in the object catalog.
The invention is best utilized by a data processing system having some form of local or resident storage memory (e.g., for storing data and instructions), and a persistent store mechanism such as conventional disk storage. The object catalog is structured to contain object-oriented class specifications, defining the different types of data items maintained in the persistent store. Data items of a particular type are stored as a collection of object instances of a class specification contained in the object catalog. Each collection of object instances relate to data items that are of a particular category; for example, savings account data items as opposed to parts inventory data items (which would form another collection of object instances of a type enumerated by a class specification contained in the object category). Each class declaration in the object catalog pertains to one particular collection of data items, and includes the name of the class, its attributes, member functions, and base classes if any. Since the stored object instances may contain both data (attributes) and function, a collection of objects of the same type will correspond to data items of a same type; i.e., the object represents variables of a data type defined by a user. Thus, the system can store multiple collections, each separately defined by a class specification in the object catalog.
In use, a class specification, describing data items of a particular form desired to be stored, is designed and placed in the object catalog. Implementation code for any member functions declared in the class specification will be formed and also stored in the object catalog with the class specification. An instance object of the class type is created for each data item desired to be stored, and put in the persistent store by the storage manager. An application program needing to access data items from a particular collection of objects of a particular type issues a xe2x80x9cgetxe2x80x9d request to the storage manager which first queries the persistent store to find the requested object instances, and returns it to the requesting application. The application may then call any member function that may be specified in the class specification contained in the object catalog to act on the data item (i.e., objection instance). When through, the application returns the object instance to the persistent store by requesting a xe2x80x9cputxe2x80x9d operation of the storage manager, and return the object instance to the database manager, which returns it to persistent store.
A further embodiment of the invention provides for attaching or otherwise associating collateral behavior to operations of the storage manager, using object-oriented programming techniques in conjunction with the database system of the present invention. According to this further embodiment, class specifiers describing handlers (i.e., code that, when called, will xe2x80x9chandlexe2x80x9d a certain event) are placed in the object catalog. Object instances of the handler class type are formed and added to the persistent store, using an addhandler operation of the storage manager. The addhandler operation will also associate the handler object instance being stored with storage manager operations on stored object instances of a specific class type. For example, if a xe2x80x9csavingsxe2x80x9d class (for savings accounts) has been specified and placed in the object catalog, object instances of that class will represent savings data type objects for each particular xe2x80x9caccountxe2x80x9d (e.g., Mr. Smith, Mr. Brown, etc.), forming a collection of savings objects stored in the persistent store. Particular operations of the storage manager (get, put, etc.) on the savings object in the persistent store can initiate use of one or more of the handler object instances to call member functions of the handler class to, in turn, launch specific collateral activity. Consider a request to the storage manager to retrieve a savings object instance (data item) by a get operation. Collateral activity associated with the get operation may include verification of the source of the request for the get. Objects of a type different from savings (e.g., objects of an inventory class specification) may have different handler objects associated with the get (or put, or other) operation of the program manager.
It will be apparent to those skilled in this art that the present invention provides advantages not believed present in present day storage systems. First is that data items of different forms may be stored merely by creating a class specifier to describe each form, and then creating and storing an object instance for each data item of each form. Second is that behavior native to data items of a particular form made readily available by the member functions declared in the class specifier for object instances that represent the data items merely by calling the member function to act on the data item.
A further advantage is the ease with which collateral activity can be attached to operations of the storage manager merely by specifying the desired activity by a class activity, adding an object instance of the class to the persistent store, and associating the object instance with a storage manager operation on object instances of a particular type. Removal merely requires deletion of the handler object instance from storage and erasure of the association. Modifications can be effected simply and easily by modifying the handler object instance itself, or by replacing the object with another.
These and other features and advantages of the present invention will become apparent to those skilled in this art by a reading of the following detailed description which should be taken in conjunction with the accompanying drawings.